package wangjg.mda.lang;

import java.util.List;

class MyField extends MyElement{
	private int namePos;
	private MyComment comment;
	private List<MyAnnotation> annos;
	private String modifiers;
	private String type;
	private String name;
	private String defaultValue;
	
	public MyField() {
		super();
	}

	public MyAnnotation getAnnotation(String annoName){
		if(annos==null){
			return null;
		}
		for(MyAnnotation anno:annos){
			if(annoName!=null&&annoName.equals(anno.getName())){
				return anno;
			}
		}
		return null;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public MyComment getComment() {
		return comment;
	}
	public void setComment(MyComment comment) {
		this.comment = comment;
	}
	public List<MyAnnotation> getAnnos() {
		return annos;
	}
	public void setAnnos(List<MyAnnotation> annos) {
		this.annos = annos;
	}
	public int getNamePos() {
		return namePos;
	}
	public void setNamePos(int namePos) {
		this.namePos = namePos;
	}

	public String getModifiers() {
		return modifiers;
	}

	public void setModifiers(String modifiers) {
		this.modifiers = modifiers;
	}

	public String getDefaultValue() {
		return defaultValue;
	}

	public void setDefaultValue(String value) {
		this.defaultValue = value;
	}

	@Override
	public String toString() {
		return "\n\t\tMyField [namePos=" + namePos + ", name=" + name + ", comment=" + comment
				+ ", annos=" + annos + ", modifiers=" + modifiers + ", type="
				+ type + ", defaultValue=" + defaultValue
				+ ", " + super.toString() + "]";
	}

}
